package com.itany.cloud.service;

import com.itany.cloud.util.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

/**
 * Author:shixiaojun@itany.com
 * Date: 2022/3/23 15:06
 * Version: 1.0-SNAPSHOT
 */
@Service
@FeignClient("cloud-nacos-provider")
public interface UserService {

    @GetMapping("/users")
    public ResponseResult findAll();

    @GetMapping("/users/{id}")
    public ResponseResult findById(@PathVariable("id") Integer id);

    @PostMapping("/users")
    public ResponseResult addUser(@RequestParam("username") String username, @RequestParam("password") String password, @RequestParam("phone") String phone, @RequestParam("address") String address);

    @DeleteMapping("/users/{id}")
    public ResponseResult deleteUser(@PathVariable("id") Integer id);

    @PutMapping("/users")
    public ResponseResult modifyUser(@RequestParam("id") Integer id, @RequestParam("username") String username,@RequestParam("password") String password,@RequestParam("phone") String phone,@RequestParam("address") String address);
}
